
const install = (Vue, vm) => {
	Vue.prototype.$u.http.setConfig({
		baseUrl:'http://120.78.140.78:90/bm',
		method: 'POST',
		dataType: 'json',
		showLoading: false,
		loadingText: '请求中...',
		loadingTime: 800,
		originalData: false,
		loadingMask: true,
		header: {
			'content-type': 'application/json;charset=UTF-8'
		}
	})
	
	// 请求拦截部分，如配置，每次请求前都会执行，见上方说明
	Vue.prototype.$u.http.interceptor.request = (config) => {
		if(uni.getStorageSync('Authorization')) {
			const token = uni.getStorageSync('Authorization')
			config.header.Authorization = token
		}
		// console.log(config)
		return config
	}
}

export default {
	install
}
